ABOUT THE APPLESHARE DEVELOPER’S KIT (APPLESHARE API)
The AppleShare Developer’s Kit documentation contains all the information you need to use server control calls, handle server events, and use the routines in UGLibrary. This disk contains the interface files needed to use server control calls, handle server events, and use the routines in UGLibrary. This AppleShare API - Read Me First document presents the following additional information:
• Information about the UGLibrary version 1.0.1.
• A clarification on restrictions in the use of UGLibrary version 1.0 and 1.0.1.
• A description of the files in the Power PC AppleShare API folder
• A description of the files in the Extras folder.
When you are finished reading this document, choose the Quit command from the File menu.
This version of the UGLibrary fixes a few small and very rare bugs. It also allows easy linking with your object files (the segment name is now uglib, not Main). Use this version exactly the same way as you used version 1.0. UGLibrary version 1.0.1 supercedes and obsoletes version 1.0.
The C header files (in other folders), ServerControlIntf.h, ServerEventIntf.h, UGLibrary.h have been updated for use in PowerPC applications. However, some additional work was needed in a couple of areas:
ServerDispatch is not in InterfaceLib, so additional glue code has been provided to implement SyncServerDispatch for PowerPC programs. The SyncServerDispatch code can be found in the folder PPC SyncServerDispatch.
There are no plans to provide UGLibrary as a native PowerPC library. However, UGLibrary has been given a wrapper and is included as a stand-alone 68K code resource that can be loaded and called from a PowerPC application. The wrapper code and the build script used to build the stand-alone code resource is included. Additional glue code has been provided to load the UGLibrary code resource and implement all UGLibrary functions for PowerPC programs. All of this code can be found in the folder PPC UGLibrary.
There are five files in the “Extras” folder of this disk. The “ServerControlSnippets.p” and “ServerEventHandler.p” files contain the Pascal source code found in the Server Control Calls and Server Event Handling documentation with a few minor bugs fixes and an update for future versions of File Sharing. The “ServerControlSnippets.c” and “ServerEventHandler.c” files are a C port of the Pascal source code. The “Server Cntr/Evnt MacsBug rsrc” file contains MacsBug 'mxbm' and 'mxwt' resources you can add to the MacsBug Debugger Prefs file in your System Folder to help you debug programs that use server control calls or server events.
After adding the resources to the Debugger Prefs file and rebooting, you can get a list of the macros with MacsBug’s MCD (list macros) command and a list of the templates with MacsBug’s TMP (list templates) command. Here is a short explanation of what you get with each resource.
The 'mxbm' Macro Resource
These macros let you trap on any call to the ServerDispatch trap ($A094) with MacsBug’s ATB command. For example, the SCShutDown macro expands to:
a094 ((ra0+1a)^.w=0002)
so an example using the SCShutDown macro to trap on SCShutDown calls would be:
ATB SCShutDown
The 'mxwt' Template Resource
These templates let you display Server Control and Server Event parameter blocks and associated data structures the way you would probably want to see them. (If you have a 'mxwt' resource titled "AppleTalk Types" in your Debugger Prefs file, you probably don’t need the ATQEntry and AddrBlock templates in the “Server Cntr/Evnt MacsBug rsrc” file.)
Here is an example of using one of the templates (SCDisconnectPB):
DM RA0 SCDisconnectPB
You can use the templates along with the macros to trap on a call and then display the parameter block passed to that call. For example:
will trap on SCShutDown, then display the parameter block passed to SCShutDown (pointed to by RA0), step over the SCShutDown call, and then display the parameter block again with the results passed back by SCShutDown.